package listbyorder.access201_300.test242;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/6/27 11:36
 */
public class Solution1 {

    public boolean isAnagram(String s, String t) {
        if (s.equals("")) return t.equals("");
        if (t.length() != s.length()) return false;
        int[] temp = new int[27];
        for (int i = 0; i < s.length(); i++) {
            temp[s.charAt(i) - 'a']++;
            temp[t.charAt(i) - 'a']--;
        }
        for (int i = 0; i < temp.length; i++) {
            if (temp[i] != 0) {
                return false;
            }
        }
        return true;
    }
}
